package com.hua.util;

import org.apache.ibatis.jdbc.Null;

import java.util.HashMap;
import java.util.Map;

/**
 * ClassName:UrlConfirm
 * Package:com.hua.util
 * Description:
 *
 * @data: 2022/10/18 15:23
 * @author:ChenJH
 */
public class UrlConfirm {
    private static final Map<String,String> map = new HashMap<>();
    static {

        map.put("/api/doc.html",null);
        map.put("/api/captcha",null);
        //用户
        map.put("/api/user/login",null);
        map.put("/api/user/getUser",null);
        map.put("/api/user/logOut",null);

        //商品信息
        map.put("/api/commodity/getCommodityList",null);
        map.put("/api/commodity/getCategoryList",null);
        map.put("/api/commodity/add",null);
        map.put("/api/commodity/delete",null);
        map.put("/api/commodity/update",null);

        //菜单列表
        map.put("/api/category/getCategory", null);
        map.put("/api/category/deleteCategory",null);
        map.put("/api/category/addCategory",null);
        map.put("/api/category/uploadImg",null);
        map.put("/api/category/user/userInfo",null);
        //茶底
        map.put("/api/teabottom/insertTeaBottom",null);
        map.put("/api/teabottom/getTeaBottom",null);
        map.put("/api/teabottom/updateTeaBottom",null);
        map.put("/api/teabottom/deleteTeaBottom",null);
        //商店信息
        map.put("/api/storeInfo/getStore",null);
        map.put("/api/storeInfo/getTotal",null);
        map.put("/api/storeInfo/storeOffOnline",null);
        map.put("/api/storeInfo/storeDown",null);
        map.put("/api/storeInfo/updateStoreInfo",null);

        //茶底
        map.put("/api/ingredient/getIngredient",null);
        map.put("/api/ingredient/insertIngredient",null);
        map.put("/api/ingredient/delete",null);
        map.put("/api/ingredient/update",null);

        //订单
        map.put("/api/order/saveOrder",null);
        map.put("/api/order/list",null);

        //优惠卷
        map.put("/api/discount/getAllDiscounts",null);
        map.put("/api/discount/deleteDiscount",null);

    }
    public static boolean getIsTure(String url){

        boolean isTrue = url.startsWith("/api/webjars") || url.startsWith("/api/swagger-resources") || url.startsWith("/api/v2");

        if(isTrue){
            return isTrue;
        }

        if(map.containsKey(url)){
            return true;
        }
        return false;
    }
}
